/* 
* File: vector_reserve.cpp
* 测试用例修改自 http://www.cplusplus.com/reference/stl/vector/vector/
* 编译命令：
* 	c++ -Wall -g  -I ../Include/ vector_reserve.cpp -o vector_reserve 
* 在这里假设所有的所需的头文件放在../Include里面
*/
// vector::reserve
#include <iostream>
#include <fstream>
//#include <vector>
#define vector Vector
#include "Vector.h"
using namespace std;

int main ()
{
	vector<int> content;
	size_t filesize;

	ifstream file ("test.bin",ios::in|ios::ate|ios::binary);
	if (file.is_open())
	{
		filesize=file.tellg();

		content.reserve(filesize);

		//cout << content.capacity() << endl;
		file.seekg(0);
		while (!file.eof())
		{
			content.push_back( file.get() );
		}

		// print out content:
		vector<int>::iterator it;
		for (it=content.begin() ; it<content.end() ; it++)
			cout << hex << *it;
	}

	return 0;
}
